package com.ruoyi.apartments.service.impl;

import java.util.List;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.apartments.mapper.MfApartmentsMapper;
import com.ruoyi.apartments.domain.MfApartments;
import com.ruoyi.apartments.service.IMfApartmentsService;



/**
 * 公寓房源信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-21
 */
@Service
public class MfApartmentsServiceImpl  implements IMfApartmentsService
{
    @Autowired
    private MfApartmentsMapper mfApartmentsMapper;



    /**
     * 查询公寓房源信息
     * 
     * @param apartmentId 公寓房源信息主键
     * @return 公寓房源信息
     */
    @Override
    public MfApartments selectMfApartmentsByApartmentId(Long apartmentId)
    {
        return mfApartmentsMapper.selectMfApartmentsByApartmentId(apartmentId);
    }

    /**
     * 查询公寓房源信息列表
     * 
     * @param mfApartments 公寓房源信息
     * @return 公寓房源信息
     */
    @Override
    public List<MfApartments> selectMfApartmentsList(MfApartments mfApartments)
    {
        return mfApartmentsMapper.selectMfApartmentsList(mfApartments);
    }

    /**
     * 新增公寓房源信息
     * 
     * @param mfApartments 公寓房源信息
     * @return 结果
     */
    @Override
    public int insertMfApartments(MfApartments mfApartments)
    {
        mfApartments.setCreateTime(DateUtils.getNowDate());
        return mfApartmentsMapper.insertMfApartments(mfApartments);
    }

    /**
     * 修改公寓房源信息
     * 
     * @param mfApartments 公寓房源信息
     * @return 结果
     */
    @Override
    public int updateMfApartments(MfApartments mfApartments)
    {
        return mfApartmentsMapper.updateMfApartments(mfApartments);
    }

    /**
     * 批量删除公寓房源信息
     * 
     * @param apartmentIds 需要删除的公寓房源信息主键
     * @return 结果
     */
    @Override
    public int deleteMfApartmentsByApartmentIds(Long[] apartmentIds)
    {
        return mfApartmentsMapper.deleteMfApartmentsByApartmentIds(apartmentIds);
    }

    /**
     * 删除公寓房源信息信息
     * 
     * @param apartmentId 公寓房源信息主键
     * @return 结果
     */
    @Override
    public int deleteMfApartmentsByApartmentId(Long apartmentId)
    {
        return mfApartmentsMapper.deleteMfApartmentsByApartmentId(apartmentId);
    }
}
